
BINNAME=employee

OBJECTS=main.o HttpGetRequest.o HttpPutRequest.o Job.o CvtColorEffect.o GaussianBlurEffect.o ResizeEffect.o Utils.o Employee.o

FLAGS=-Wall

# Open CV Dependencies
OPENCV=`pkg-config --cflags opencv` `pkg-config --libs opencv`
POCO=-I/usr/local/include/Poco -lPocoUtil -lPocoNet -lPocoXML -lPocoFoundation

SERVER=127.0.0.1
PORT=7070

SRCDIR=src
BINDIR=bin
HDRDIR=include

default: $(OBJECTS)
	g++ $(FLAGS) $(OBJECTS) $(OPENCV) $(POCO) -I$(HDRDIR) -o $(BINDIR)/$(BINNAME)

$(OBJECTS): bindir
	g++ -c $(FLAGS) $(SRCDIR)/$*.cpp $(OPENCV) $(POCO) -I$(HDRDIR) -o $@

test-mem: default
	valgrind $(BINDIR)/$(BINNAME) $(SERVER) $(PORT)

tar: clean
	rm -fr /tmp/$(BINNAME)
	svn export . /tmp/$(BINNAME)
	tar -C /tmp/$(BINNAME) -czf $(BINNAME).tar.gz *
clean:
	rm -fr $(BINDIR)
	rm -f *.o $(BINDIR)/$(BINNAME) $(BINNAME).tar.gz

bindir:
	mkdir -p $(BINDIR)